home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / dskut / chksum2.zip / GEN.H < prev    next >
C/C++ Source or Header  |  1989-02-16  |  3KB  |  111 lines

  1. /*    /usr/include/stub/gen.h    890123    NHA    */
  2. /* This is the version for use with public sharing of my sources */
  3. /* The intent is to neutralize initdebug() and printd() so that */
  4. /* any compiler will swallow them without complaint */
  5.  
  6. #ifndef    __GEN__
  7. #define    __GEN__
  8.  
  9. #include    <stdio.h>
  10. #include    <fcntl.h>
  11. #include    <ctype.h>
  12. /** #include    "config.h" **/
  13. #include    <debug.h>
  14.  
  15. #define    import            extern
  16. #define    local            static
  17. #define    export
  18. /**    This will not work with prototypes in version 4.10a **/
  19. /** typedef    char            bool; **/
  20. typedef int                bool;
  21. #define    NULLFP            ((int (*)())0)            /* NULL Function Pointer */
  22.  
  23. #define    YES        1
  24. #define    NO        0
  25. #define    NOBREAK                /* used for a switch case which flows into next */
  26. #define    CRLF    037            /* Unit Separator sometimes replaces \n\r pair */
  27.  
  28. /*** NOTE that this include must follow the definition of bool ***/
  29. /** #include    <window.h> **/                    /* Norman's direct windows */
  30. /** import WINDOW    *wopen(char *dev); **/
  31.  
  32. /* macros */
  33. #define    abs(x)        ((x < 0) ? (-(x)) : (x))
  34. #define    max(x,y)    (((x) < (y)) ? (y) : (x))
  35. #define    min(x,y)    (((x) < (y)) ? (x) : (y))
  36.  
  37.  
  38. /* for use with Aztec farcall(), sysint(), and segreg() functions */
  39. struct regs        { int    ax, bx, cx, dx, si, di, ds, es; };
  40. struct segregs    { unsigned    cs, ss, ds, es; };
  41.  
  42. /* use this to fiddle with longs and pointers and such */
  43. union u_long    {
  44.                 unsigned long            lunsigned;
  45.                 long                    lsigned;
  46.                 void                    *ptr;
  47.                 struct    {
  48.                         unsigned        lo;
  49.                         unsigned        hi;
  50.                         }                half;
  51.                 struct    {
  52.                         unsigned char    b0;        /* Least Significant byte */
  53.                         unsigned char    b1;
  54.                         unsigned char    b2;
  55.                         unsigned char    b3;        /* Most Significant byte */
  56.                         }                byte;
  57.                 };
  58.  
  59.  
  60. #define    BIT0    0x0001
  61. #define    BIT1    0x0002
  62. #define    BIT2    0x0004
  63. #define    BIT3    0x0008
  64. #define    BIT4    0x0010
  65. #define    BIT5    0x0020
  66. #define    BIT6    0x0040
  67. #define    BIT7    0x0080
  68. #define    BIT8    0x0100
  69. #define    BIT9    0x0200
  70. #define    BIT10    0x0400
  71. #define    BIT11    0x0800
  72. #define    BIT12    0x1000
  73. #define    BIT13    0x2000
  74. #define    BIT14    0x4000
  75. #define    BIT15    0x8000
  76.  
  77. #define    BIT0L    0x00000001
  78. #define    BIT1L    0x00000002
  79. #define    BIT2L    0x00000004
  80. #define    BIT3L    0x00000008
  81. #define    BIT4L    0x00000010
  82. #define    BIT5L    0x00000020
  83. #define    BIT6L    0x00000040
  84. #define    BIT7L    0x00000080
  85. #define    BIT8L    0x00000100
  86. #define    BIT9L    0x00000200
  87. #define    BIT10L    0x00000400
  88. #define    BIT11L    0x00000800
  89. #define    BIT12L    0x00001000
  90. #define    BIT13L    0x00002000
  91. #define    BIT14L    0x00004000
  92. #define    BIT15L    0x00008000
  93. #define    BIT16L    0x00010000
  94. #define    BIT17L    0x00020000
  95. #define    BIT18L    0x00040000
  96. #define    BIT19L    0x00080000
  97. #define    BIT20L    0x00100000
  98. #define    BIT21L    0x00200000
  99. #define    BIT22L    0x00400000
  100. #define    BIT23L    0x00800000
  101. #define    BIT24L    0x01000000
  102. #define    BIT25L    0x02000000
  103. #define    BIT26L    0x04000000
  104. #define    BIT27L    0x08000000
  105. #define    BIT28L    0x10000000
  106. #define    BIT29L    0x20000000
  107. #define    BIT30L    0x40000000
  108. #define    BIT31L    0x80000000
  109.  
  110. #endif    __GEN__
  111.